/*******************************************
Syntax to obtain power estimates for Table OA7
**********************************************/


/******************************************
* Experiment 1
*******************************************/
clear
cd "C:\Users\Joshua\OneDrive\Documents\Work - Finished\BJPS - Comp Explanations\Dataverse"
use exp1_cleaned.dta

by cond_info, sort: summ therm01

***Just vs. Teacher
recode cond_info (3=0) (4 = 1) (else=.), gen(just_teacher)

***Just vs. No Just
recode cond_info (3=0) (2 = 1) (else=.), gen(just_nojust)

***Just vs. Partisan
recode cond_info (3=0) (6 = 1) (else=.), gen(just_partisan)

***Just vs. Non-Partisan
recode cond_info (3=0) (5 = 1) (else=.), gen(just_nonp)

**Teacher vs. Partisan
recode cond_info (4=1) (6 = 0) (else=.), gen(teachers)

**Non Partisan vs Partisan
recode cond_info (5=1) (6=0) (else=.), gen(nonp)

summ just_*

foreach var in just_nojust just_teacher just_nonp just_partisan teachers nonp { 
	esize twosample therm01, by(`var')
}

foreach var in teachers nonp { 
	esize twosample therm01 if cond_party1 == 1, by(`var')
}

foreach var in teachers nonp { 
	esize twosample therm01 if cond_party1 == 2, by(`var')
}


/******************************************
* Experiment 2
*******************************************/

clear
use exp2_cleaned.dta

recode treat_expl (2 = 1) (1 = 0) (else=.), gen(just_nojust)
recode treat_expl (2 = 1) (3 = 0) (else=.), gen(just_hc)
recode treat_expl (2 = 1) (4 = 0) (else=.), gen(just_lc)
recode treat_expl (3 = 1) (4 = 0) (else=.), gen(hc)

foreach var in just_nojust just_hc just_lc hc {
		esize twosample therm_post01, by(`var')
}

/******************************************
* Experiment 3
*******************************************/


clear
use exp3_cleaned.dta

*********Exp 3a
recode gil_exp (2 = 1) (1 = 0) (else=.), gen(gil_just_nojust)
recode gil_exp (2 = 1) (3 = 0) (else=.), gen(gil_just_lw)
recode gil_exp (2 = 1) (4 = 0) (else=.), gen(gil_just_rw)
recode gil_exp (3 = 1) (4 = 0) (else=.), gen(lw_rw)

foreach var in gil_just_nojust gil_just_lw gil_just_rw lw_rw { 
	esize twosample gil_post01, by(`var')
}

**********Exp 3b


recode corker_exp (2 = 1) (1 = 0) (else=.), gen(corker_just_nojust)
recode corker_exp (2 = 1) (3 = 0) (else=.), gen(corker_just_lw)
recode corker_exp (2 = 1) (4 = 0) (else=.), gen(corker_just_rw)
recode corker_exp (3 = 1) (4 = 0) (else=.), gen(corker_lw_rw)


foreach var in corker_just_nojust corker_just_lw corker_just_rw corker_lw_rw { 
	esize twosample corker_post01, by(`var')
}


